<template>
    <div style="padding: 10px; width: calc(100% - 20px); word-break: break-all;">
        <el-button type="primary" @click="openWindowCallback">测试打开客户端弹窗并回调</el-button> &nbsp;<br/>
        选择结果：<br/>{{ JSON.stringify(selectedInfo) }}
    </div>
</template>

<script>
import { mapState } from 'vuex'
import { openAppClient, closeAppClient } from '@/utils/common'
export default {
    computed: {
        ...mapState(['selectedInfo'])
    },
    created () {
        window.testFun = () => {
            alert('关闭弹窗时触发打开页面方法')
            closeAppClient()
        }
    },
    beforeDestroy () {
        window.testFun = null
    },
    methods: {
        openWindowCallback () {
            openAppClient('/test', '', null, null, null, 'testFun')
        },
    }
}
</script>

<style>

</style>